#include<iostream>
#include<map>
using namespace std;

namespace test1 {
	void PrintMap(map<int, int>& mp) {

		for (map<int, int>::iterator it = mp.begin(); it != mp.end(); it++) {
			cout << "key=" << it->first << ",value=" << it->second << endl;
		}
	}

	int main13() {
		map<int, int> m1;
		m1.insert(pair<int, int>(1, 10));
		m1.insert(pair<int, int>(3, 30));
		m1.insert(make_pair(2, 20));
		m1.insert(make_pair(4, 40));
		m1.insert(map<int, int>::value_type(7, 70));
		m1.insert(map<int, int>::value_type(6, 60));
		printf("m1:\n");
		PrintMap(m1);

		map<int, int>/* m2(m1);
		printf("m2:\n");
		PrintMap(m2)*/;

		map<int, int> m3;
		m3 = m1;
		auto result = m1.insert(make_pair(2, 21));
		if (result.second == false) {
			result.first->second = 21;
		}
		printf("m1:\n");
		PrintMap(m1);
		printf("m3:\n");
		PrintMap(m3);


		return 0;
	}
}